<?php

namespace Config;

class mysql
{
    public static function mysql()
    {
        $dbType = 'mysql';
        $dbHost = 'localhost';
        $dbName = 'test';
        $dbUser = 'root';
        $dbPass = 'root';
        $dsn = "$dbType:host=$dbHost;dbname=$dbName";
        try {
            $dbLink = new \PDO($dsn, $dbUser, $dbPass);
            $dbLink->query("set names utf8");
            return $dbLink;
        } catch (\PDOException $e) {
            print "Error!: " . $e->getMessage() . "<br/>";
            die();
        }
    }
}